<template>
  <div class="app-container customer-div">
    <el-tabs v-model="activeName" style="margin-top:20px;" type="card">
      <el-tab-pane label="我的产品线日目标" name="first">
          <myGoodsLineTarget></myGoodsLineTarget>
      </el-tab-pane>
      <el-tab-pane label="我的采购日目标" name="second">
          <myPurchaseTarget></myPurchaseTarget>
      </el-tab-pane>
      <el-tab-pane label="月目标" name="third" v-if="monthTarget">
          <monthTarget></monthTarget>
      </el-tab-pane>
      <el-tab-pane label="全部产品线日目标" name="fifth" v-if="allGoodsLineTarget">
         <allGoodsLineTarget></allGoodsLineTarget>
      </el-tab-pane>
      <el-tab-pane label="全部采购日目标" name="sixth" v-if="allPurchaseTarget">
         <allPurchaseTarget></allPurchaseTarget>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script>

import {formatDate} from '@/utils/date';
import store from '@/store'
import { mapGetters } from 'vuex'
import myGoodsLineTarget from './components/myGoodsLineTarget'
import myPurchaseTarget from './components/myPurchaseTarget'
import monthTarget from './components/monthTarget'
import allGoodsLineTarget from './components/allGoodsLineTarget'
import allPurchaseTarget from './components/allPurchaseTarget'


export default {
  name: "index",
  data(){
    return {
      activeName:'first',
      roles:store.getters.roles ? store.getters.roles : [],
    }
  },
  components: { myGoodsLineTarget,myPurchaseTarget,monthTarget,allGoodsLineTarget,allPurchaseTarget},
  computed: {
    ...mapGetters([
      'name',
      'mobile',
      'userId',
      'isMange',
    ]),
    monthTarget(){
      if(this.roles.indexOf("monthTarget") != -1){
        return true
      }else{
        return false
      }
    },
    chargePerson(){
      if(this.roles.indexOf("chargePerson") != -1){
        return true
      }else{
        return false
      }
    },
    allGoodsLineTarget(){
      if(this.roles.indexOf("allGoodsLineTarget") != -1){
        return true
      }else{
        return false
      }
    },
    allPurchaseTarget(){
      if(this.roles.indexOf("allPurchaseTarget") != -1){
        return true
      }else{
        return false
      }
    },
  },
  created() {

  },
  filters: {



  },
  methods:{

  },
}
</script>

<style scoped lang="scss">

</style>
